package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

import java.util.HashMap;
import java.util.Map;


/**
 * @description 作业状态
 *
 * @author leo
 * @date 2020/10/09
 **/
public enum WmsTaskJobStatusEnum implements IEnum<String> {
    /**
     * 待作业
     */
    WAITING("WAITING","待作业"),
    /**
     * 作业中
     */
    WORKING("WORKING","作业中"),
    /**
     * 作业完成
     */
    COMPLETED("COMPLETED","作业完成");

    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    WmsTaskJobStatusEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static final Map<String, WmsTaskJobStatusEnum> ENUM_MAP = new HashMap();

    static {
        WmsTaskJobStatusEnum[] values = values();
        int length = values.length;
        for(int i = 0; i < length; i++){
            WmsTaskJobStatusEnum value1 = values[i];
            ENUM_MAP.put(value1.getValue(),value1);
        }
    }

    public static WmsTaskJobStatusEnum getEnumByValue(String value){

        return ENUM_MAP.get(value);
    }
    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
